<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>04_JS的流程控制</title>
</head>
<body>
<script >
    console.log(1);
    console.log(2)  ;
    console.log(3);

    var age = 18;
    if(age >= 18){
        console.log('可以投票');
    }else{
        console.log('不可以投票');
    }
    //
    // let uname='yu';
    // if (!uname){
    //     alert('请输入用户名');
    // }else  {
    //    alert('欢迎登录'+uname);
    // }
    let gender = 10;
    switch (gender) {
        case 1:
            console.log('男');
            break;
        case 2:
            console.log('女');
            break;
        default:
            console.log('未知');
    }
    let names = ['yu','yu1','yu2'];
    for (var i = 0; i < names.length; i++) {
        console.log(names[i]);
    }
    console.log('循环结束');
    console.log(i);

    for (let n of  names) {
        console.log(n);
    }



</script>
</body>
</html>